<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 

   $this ->session-> unset_userdata($reg_email);   //clean the session data for sending email interval

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0035)http://passport.panli.com/Register/ -->
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="/mysite/images/register.css" rel="stylesheet" type="text/css">
		<link href="http://sf.panli.com/FrontEnd/images20090801/favicon.ico?v=3.0" type="image/ico" rel="shortcut icon">
    <script src="/mysite/js/jquery-1.3.2.min.js" type="text/javascript"></script>

    <title>
	注册 - Qiuqu Taobao 奇趣淘宝
</title>
<script type="text/javascript" src="chrome-extension://dlnembnfbcpjnepmfjmngjenhhajpdfd/resources/LocalScript.js"></script>
<script type="text/javascript" src="chrome-extension://dlnembnfbcpjnepmfjmngjenhhajpdfd/libraries/DataExchangeScript.js"></script>

</head>
<body>
<form name="form1" method="post" action="index.htm" id="form1">
<div>
</div>
    <div class="top">
        <div class="logo">
                <img src="/mysite/images/logo.gif" alt="Panli"  >
        </div>
        <div class="hy">
            <img src="/mysite/images/hy.gif" alt=""></div>
        <div class="T_right">
            <a href="http://www.panli.com/">返回首页</a><span>|</span><a href="http://www.panli.com/Help.aspx">帮助信息</a>
        </div>
    </div>
    <div class="box">
        

        <script type="text/javascript">

            function emailWebsite(inputEmail){  
                 var domain = inputEmail.split("@");    //split email address with @
                 if (domain.length==2){
                     return "http://www." + domain[1]; 
                 }
                 else {
                     return "http://www.google.com"; 
                 }
            }
        
            function emailInputShow(e) {
                if (e && e.stopPropagation) {
                    e.stopPropagation();
                }
                else {
                    window.event.cancelBubble = true;
                }
                $('#bgdiv').show();
                $("#changeEmail").show(0, function() { $("#codeImage").click(); });
                $("#changeEmailCode").val("");
                $("#cEmail").removeAttr("class").text("此邮箱将作为您登录Qiqu taobao的帐号！");
                $("#cemailinput").val("");
            }

            function changeEmail(e) {
                if (e && e.stopPropagation != undefined) { e.stopPropagation(); }
                else { window.event.cancelBubble = true; }

                var checkCode = $.trim($("#changeEmailCode").val());
                if (checkCode.length <= 0) {
                    $("#cEmail").attr("class", "red").text("请输入验证码！"); return;
                }

                $.ajax({
                    type: "get",
                    url: "<?php REGISTER_PAGE() .  '/iscodevalid?code='; ?>" + checkCode,
                    dataType: "text",
                    timeout: 5000,
                    error: function(a, b, c) { 
                        checkcodechecked = true; 
                        $("#cEmail").removeAttr("class").text("此邮箱将作为您登录Qiqu taobao的帐号！"); 
                        changeEmailSuc(); },
                    success: function(msg) {
                        if (msg == 'false') {
                            $("#cEmail").attr("class", "red").text("验证码错误！"); 
                            return;
                        }
                        else {
                            $("#cEmail").removeAttr("class").text("此邮箱将作为您登录Qiqu taobao的帐号！");
                            changeEmailSuc();
                        }
                    }
                });
            }


            function changeEmailSuc() {
                var email = $("#cemailinput").val();
                if (email.length <= 0) { 
                    $("#cEmail").attr("class", "red").text("请输入您的Email地址！"); 
                    return; 
                }
                var reg = new RegExp("\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*");
                if (reg.test($("#cemailinput").val())) {
                    $.ajax({
                        type: "get",
                        url: "<?php REGISTER_PAGE() . '/changeemail?oldemail=' . $reg_email ; ?>&newemail=" + email,
                        dataType: "text",
                        contentType: "application/json;utf-8",
                        //data: "email='" + email + "'" ,
                        timeout: 10000,
                        beforeSend: function() { 
                            $("#cEmail").attr("class", "lv").text("正在修改您的Email，请稍候！"); 
                            $("#changeEmailBtn").attr("disabled", "disabled"); 
                           },
                        error: function() {
                             $("#cEmail").attr("class", "red").text("网络连接失败！"); 
                             $("#changeEmailBtn").removeAttr("disabled"); 
                           },
                        success: function(rstr) {
                           //  alert(rstr);
                            if (rstr == "error") { window.location = "/"; return; }
                            if (rstr == "used") { $("#cEmail").attr("class", "red").text("该Email地址已经被使用！"); }
                            if (rstr == "nouser") { $("#cEmail").attr("class", "red").text("Email地址修改失败！"); }
                            if (rstr == "again") { $("#cEmail").attr("class", "red").text("您操作过于频繁，请过10分钟后再试！"); }
                            if (rstr == "success" || rstr == "fail") { 
                                  $("#cEmail").text("已成功修改您的Email并发送新的激活邮件，请注意查收！"); 
                                  $("#changeEmail").hide(); 
                                  $("#registerEmail").html(email); 
                                  $("#gotoMailbox").attr("href", emailWebsite(email));   
                                  $("#successChange").show(); 
                            }
                            if (rstr == "wrong") { $("#cEmail").attr("class", "red").text("您输入的Email地址格式不正确！"); }
                            $("#changeEmailBtn").removeAttr("disabled");
                        }
                    });
                }
                else {
                    $("#cEmail").attr("class", "red").text("您输入的Email地址不正确！");
                }
            }

            function reSendEmail() {
                $.ajax({
                    type: "GET",
                    url: "<?php echo REGISTER_PAGE(). '/resendactivationemail?email=' ; ?>" + $("#registerEmail").text(),
                    dataType: "text",
                    contentType: "application/json;utf-8",
                    timeout: 10000,
                    error: function() { 
                        alert("网络连接失败，请稍后再试！"); 
                    },
                    success: function(msg) { 
                        // alert(msg);
                        if (msg == "success") { 
                            alert("新的激活邮件已经发送到您的邮箱，请注意查收！"); 
                        } 
                        else { 
                            
                            if (msg == "again"){ 
                                alert("您发送邮件过于频繁，请过10分钟后再试");
                            }     
                            else { 
                                if (msg == "approved") { 
                                    alert("您的帐号已经激活！请前往登陆"); 
                                    window.location = "/Login.aspx" 
                                } 
                                else { 
                                    alert("激活邮件发送失败！"); 
                                } 
                          } 
                       }
                    }   
                });
            }


            $(document).ready(function() {
                $("#changeEmail").click(function(e) { if (e && e.stopPropagation) { e.stopPropagation(); } else { window.event.cancelBubble = true; } });
                $("#successChange").click(function(e) { if (e && e.stopPropagation) { e.stopPropagation(); } else { window.event.cancelBubble = true; } });
                $(document).click(function(e) {
                    if ($("#changeEmail:hidden").length > 0) {
                        //if ($.trim($("#cemailinput").val()).length == 0) $("#cemailinput").attr("class", "c1").val("请输入Email地址");
                        $("#cEmail").removeAttr("class").text("此邮箱将作为您登录Panli的帐号！");
                    } $("#changeEmail").hide(); $('#bgdiv').hide(); $("#successChange").hide();
                });
            });
        </script>

        <div class="move">
            <img src="/mysite/images/move2.gif" alt="激活帐户"></div>
        <div class="activation">
            <div class="mail">
                <h2>
                    系统已向您的邮箱<span id="registerEmail"><?php echo $reg_email; ?></span>发送验证邮件</h2>
                <dl>
                    <dt>点击邮件中的链接地址，即可完成激活账户！</dt>
                    <dd>
                        <a href="<?php echo emailWebsite($reg_email); ?>" target="_blank"  id="gotoMailbox">前往您的邮箱收取邮件</a></dd>
                </dl>
            </div>
            <div class="operate">
                <h2>
                    如果长时间未收到Qiqu taobao发送的邮件，您可以尝试：</h2>
                <ul>
                    <li>查看邮箱的垃圾箱或广告箱，邮件可能被误放入其中；</li>
                    <li>如果一直无法找到验证邮件，可点击<a href="javascript:void(0);" onclick="reSendEmail()">重新发送</a>；</li>
                    <li>您也可以<a onclick="emailInputShow(event)" href="javascript:void(0);">更换其他邮箱</a> ，再收验证邮件。</li>
                </ul>
                <div class="floor" id="bgdiv" style="display: none; ">
                </div>
                <div id="changeEmail" class="change" style="display: none; ">
                    <a href="javascript:;" onclick="$('#changeEmail').hide();$('#bgdiv').hide();" class="close" title="关闭"></a>
                    <p id="cEmail">此邮箱将作为您登录Panli的帐号！</p>
                    <table>
                        <tbody><tr>
                            <td class="zuo">
                                邮箱地址：
                            </td>
                            <td>
                                <input id="cemailinput" class="c1" type="text">
                            </td>
                        </tr>
                        <tr>
                            <td class="zuo">
                                验证码：
                            </td>
                            <td>
                                <input class="c3" id="changeEmailCode" type="text">
                                <img id="codeImage" src="<?php echo CAPTCHA_IMG(); ?>" 
                                title="点击图片刷新" alt="验证码"  style="vertical-align:middle;cursor:pointer; width:120px; hegith:26px;" 
                                onclick="this.src=<?php echo CAPTCHA_IMG_RAN; ?> " border="0">
                            </td>
                        </tr>
                    </tbody></table>
                    <input id="changeEmailBtn" class="c2" onclick="changeEmail(event);" name="" type="button" value="确定发送" 
                    onmouseover="this.className='c2_'" onmouseout="this.className='c2'">
                </div>
                <div id="successChange" class="change" style="display: none; ">
                    <a href="javascript:;" onclick="$('#successChange').hide();$('#bgdiv').hide();" class="close" title="关闭"></a>
                    <div class="ch_top">
                        已向您的新邮箱发送验证邮件！<br>
                        点击邮件中的链接地址，即可完成验证！
                    </div>
                    <p class="tishi">
                        此邮箱将作为您登录Panli的帐号！</p>
                </div>
            </div>
        </div>
        
    </div>
    <div class="bottom">
    </div>
    <div class="foot">
        <p>
            <a href="http://hr.panli.com/" target="_blank">关于Panli</a>&nbsp;|&nbsp;<a href="http://www.panli.com/news/about.aspx?nid=5">联系我们</a>&nbsp;|&nbsp;<a href="http://hr.panli.com/job_index.aspx" target="_blank">加入Panli</a><span>&nbsp;|&nbsp;<a target="_blank" href="http://tech.panli.com/">官方博客</a>
        </span></p>
        Copyright ©2012 Qiuqu Taobao Inc. All rights reserved.
    </div>
    </form>

</body></html>